<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="stylesheet" href="css/amazeui.min.css"/>
    <link rel="stylesheet" href="css/admin.css"/>
</head>

<body>
<div class="admin-content-body">
    <div class="am-cf am-padding am-padding-bottom-0">
        <div class="am-fl am-cf"><strong class="am-text-primary am-text-lg">管理员管理</strong>
            <small></small>
        </div>
    </div>
    <hr>
    <div class="am-g">
        <div class="am-u-sm-12">
            <form class="am-form">
                <table class="am-table am-table-striped am-table-hover table-main">
                    <thead>
                    <tr>
                        <th class="am-hide-sm-only">管理员ID</th>
                        <th class="table-type">管理员用户名</th>
                        <th class="table-set">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach items="${list}" var="list1">
                        <tr>
                            <td>${list1.sysId}</td>
                            <td class="am-hide-sm-only">${list1.sysName}</td>
                            <td>
                                <div class="am-btn-toolbar">
                                    <div class="am-btn-group am-btn-group-xs">
                                            <%--<a class="am-btn am-btn-default am-btn-xs am-text-secondary"><span class="am-icon-pencil-square-o"></span> 编辑</a>
                                            --%><a
                                            class="am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only"
                                            onclick="delUser(${list1.sysId})">
                                        删除</a>
                                    </div>
                                </div>
                            </td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
                <hr>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript">
    function delStudent(adminId) {
        inputName = adminId;
        $.ajax({
                type: "get",
                url: "/admin/del",
                data: {"adminId": inputName},
                dataType: 'json',
                success: function (data) {
                    //  location.reload();
                    parent.location.reload();
                    alert("删除成功！");
                }
            }
        )
    }
</script>
</body>
</html>